package com.iwhalecloud.bss.kite.cucc.service.attr.linkhandler;

import com.iwhalecloud.bss.kite.common.util.KiteStringUtils;
import com.iwhalecloud.bss.kite.cucc.service.attr.LocalAttrHelper;
import com.iwhalecloud.bss.kite.cucc.service.attr.handler.CustomerTradeSwitchAttrHandle;
import com.iwhalecloud.bss.kite.listener.handler.attr.annotation.AttrHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.impl.AbstractAttrLinkageHandler;
import com.iwhalecloud.bss.kite.manager.inst.KiteAttr;
import com.iwhalecloud.bss.kite.manager.inst.KiteInst;
import com.iwhalecloud.bss.kite.service.attr.AttrData;
import org.springframework.stereotype.Service;

/**
 * 客户行业类型为金融行业控制展示二级行业类型
 * Created by huangfeiteng on  2021/04/07
 */
@Service
@AttrHandler(CustomerTradeSwitchAttrHandle.class)
public class CustomerTradeSwitchAttrLinkHandler extends AbstractAttrLinkageHandler<AttrData> {
    @Override
    public void handle(KiteAttr kiteAttr, KiteInst kiteInst, AttrData attrData) {
        String kiteAttrValue = kiteAttr.getValue();
        if(KiteStringUtils.equals("100000693",kiteAttrValue)){//客户行业类型为金融行业
            //二级行业类型属性
            LocalAttrHelper.showAndNotNull(kiteInst,"200001064");
        }else{
            LocalAttrHelper.hideAndNullable(kiteInst,"200001064");
        }
    }

    @Override
    public void handleStyle(KiteAttr kiteAttr, KiteInst kiteInst, AttrData attrData) {

    }
}
